package at.com.vn.chess.entity;

import javax.xml.bind.annotation.XmlAttribute;

import vn.nnn.shogi.quanco.QuanCo;

/**
 * @author nghilt
 * 2011/11/01
 */
public class H {
	/**
	 * Ten quan co
	 */
	private String oldN;
	private String newN;


	/**
	 * Toa do cu X
	 */
	private Integer oldX;

	/**
	 * Toa do cu Y
	 */
	private Integer oldY;

	/**
	 * Toa do moi X
	 */
	private Integer newX;

	/**
	 * Toa do moi Y
	 */
	private Integer newY;

	/**
	 * Mau sac quan vua moi danh xong
	 * 1: Quan den
	 * 0: Quan trang
	 */
	private Integer oldC;
	private Integer newC;

	private boolean oldTb;
	private boolean newTb;

	private Integer idx;

	public H() {
		oldN = "";
		newN = "";
		oldX = 0;
		oldY = 0;
		newX = 0;
		newY = 0;
		oldC = QuanCo.QUAN_DEN;
		newC = QuanCo.QUAN_DEN;
		oldTb = false;
		newTb = false;
		idx = 0;
	}

	public H( int idx, QuanCo quanCo, ChessInfo newInfo ) {
		this();
		this.idx = idx;

		oldN = quanCo.getClass().getSimpleName();
		newN = newInfo.getName();
		oldX = quanCo.getX();
		oldY = quanCo.getY();
		oldTb = quanCo.isTuBinh;

		newX = newInfo.getX();
		newY = newInfo.getY();
		oldC = quanCo.color;
		newC = newInfo.getColor();
		newTb = newInfo.getIsTB();
	}

	public String getOldN() {
		return oldN;
	}

	public void setOldN(String oldN) {
		this.oldN = oldN;
	}

	public String getNewN() {
		return newN;
	}

	public void setNewN(String newN) {
		this.newN = newN;
	}

	public Integer getOldX() {
		return oldX;
	}

	public void setOldX(Integer oldX) {
		this.oldX = oldX;
	}

	public Integer getOldY() {
		return oldY;
	}

	public void setOldY(Integer oldY) {
		this.oldY = oldY;
	}

	public Integer getNewX() {
		return newX;
	}

	public void setNewX(Integer newX) {
		this.newX = newX;
	}

	public Integer getNewY() {
		return newY;
	}

	public void setNewY(Integer newY) {
		this.newY = newY;
	}

	public Integer getOldC() {
		return oldC;
	}

	public void setOldC(Integer oldC) {
		this.oldC = oldC;
	}

	public Integer getNewC() {
		return newC;
	}

	public void setNewC(Integer newC) {
		this.newC = newC;
	}
	public boolean isOldTb() {
		return oldTb;
	}

	public void setOldTb(boolean oldTb) {
		this.oldTb = oldTb;
	}

	public boolean isNewTb() {
		return newTb;
	}

	public void setNewTb(boolean newTb) {
		this.newTb = newTb;
	}

	@XmlAttribute
	public Integer getIdx() {
		return idx;
	}

	public void setIdx(Integer idx) {
		this.idx = idx;
	}
}
